The functions invvec and invvech are the inverses of vec and vech i.e. they form matrices from vectors.
vec(x)
vech(x)
invvec(x)
invvech(x)
x <- matrix(1:9, nrow=3, ncol=3)
vec(x)
vech(x)
invvec(vec(x))
invvech(vech(x))
Run the code above in your browser using DataLab